import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-03-14
 * Time: 18:48
 */
//一般情况，一个java文件一个类
    //每一个类，对应一个字节码文件

 public class Test1 {
    public static void main(String[] args) {//两个单身狗
        int[] arr = {1,5,3,3,1,6};
        int t = arr[0];
        int n1 = 0;
        int n2 = 0;
        for (int i = 1; i < arr.length; i++) {
            t ^= arr[i];
        }
        int ret = t & (~t + 1);
        for(int i = 0 ;i < arr.length; i++) {
            if((ret & arr[i]) == ret) {
                n1 ^= arr[i];
            } else {
                n2 ^= arr[i];
            }
        }

        System.out.println(n1+" "+n2);

    }
    public static void main2(String[] args) {
        int[] arr = {1,6,6,8,9,1,8};
        int t = arr[0];
        for (int i = 1; i < arr.length; i++) {
            t ^= arr[i];
        }
        System.out.println(t);
    }
    public static void func(int[] arr) {
        int low = 0;
        int fast = arr.length - 1;
        while(low < fast) {
            while (low < fast && arr[low] % 2 != 0) {
                low++;
            }
            while (low < fast && arr[fast] % 2 == 0) {
                fast--;
            }
            if(low < fast){
                int tmp = arr[low];
                arr[low] = arr[fast];
                arr[fast] = tmp;
                low++;
                fast--;
            }
        }
    }
    public static void main1(String[] args) {
        int[] arr = {1,1,3,5,7,9};
        func(arr);
        System.out.println(Arrays.toString(arr));
    }
}
